<include file="public:top" />
<!--编辑菜单-->
<form class="layui-form layui-form-pane" action="" style="padding:20px;">
   
  <div class="layui-form-item">
    <label class="layui-form-label">专辑名称</label>
    <div class="layui-input-block">
      <input type="text" name="title" id="title" placeholder="请输入" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item" id="ad_image">
    <label class="layui-form-label">专辑封面</label>
    <div class="layui-input-block">
       <button type="button" name="img" class="layui-btn layui-btn-primary" id="upimg"><i class="layui-icon"></i>只允许图片文件</button>
    </div>
    <div class="layui-input-block" style="display: none;margin-top: 10px;" id="imgdiv">
    <img src="" height="36" id="imgval" style="display: none;">
    </div>
  </div>

  <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">专辑简介</label>
      <div class="layui-input-block">
        <textarea name="intro" class="layui-textarea"></textarea>
      </div>
    </div>

  <div class="layui-form-item" pane>
    <label class="layui-form-label">是否置顶</label>
    <div class="layui-input-block">
      <input type="radio" name="zhiding" value="1" title="{:L('yes')}" >
      <input type="radio" name="zhiding" value="0" title="{:L('no')}" checked="">
    </div>
  </div>

  <div class="layui-form-item" pane>
    <label class="layui-form-label">{:L('enabled')}</label>
    <div class="layui-input-block">
      <input type="radio" name="status" value="1" title="{:L('yes')}" checked="">
      <input type="radio" name="status" value="0" title="{:L('no')}">
    </div>
  </div>

  <div class="layui-form-item">
        <label class=""></label>
        <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="content_edit">提交保存</button>
        </div>
    </div>
<input type="hidden" name="img" id="J_img">
</form>



<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
//Demo
layui.use(['layer','jquery','form','upload'], function () {
    // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form, upload = layui.upload;
 
   //上传图片
    upload.render({
    elem: '#upimg'
    ,url: "{:U('zj/ajax_upload_img')}"
    ,field:'img'
    ,acceptMime: 'image/*'
    ,done: function(res, index, upload){
      if (res.status == 1) {
        layer.msg('上传成功',{time:1800});
        var path = "{$img_dir}" + res.info;
        $('#J_img').val(res.info);
        $('#imgdiv').show();
        $('#imgval').show().attr('src',path); 
      }else {
        layer.msg('上传失败',{time:1800});
      }
    }
  }); 

 

    Oper.initUpdate(layui, '广告', 'content_edit', 'zj/add');

    

});
</script>